import {isWeiXin,towxurl,tovueurl} from '../config/common.js'
//判断是否登录
export let hasuid = function(){
	var state=1;
	if(isWeiXin()){
		var sid=sessionStorage.getItem('sid')
		var wxloginurl=tovueurl('#/wxlogin')
		wxloginurl=encodeURIComponent(wxloginurl)
		var gotourl=`http://u.mysun365.com/UserCenter/chat/simpleAcsAuth.jsp?sysType=ADCARD&logValue=wd192xd129&gotoUrl=`+wxloginurl+`&scope=snsapi_base`
		if(!sid){
			location.href=gotourl
			state=0
		}
		if(sid){
			state=1
		}
	}
	else{
		if(!uid){
			state=0
			mainView.router.loadPage('login.html')
		}	
	}
	return state
}

